package com.test.spring.util.aspect.datasource;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * Created by ll on 2017/2/5.
 */
public class DataSourceRouter extends AbstractRoutingDataSource{

    /**
     * 获取数据源（依赖于spring）,由spring调用
     */
    @Override
    protected Object determineCurrentLookupKey() {
        return DataSourceHandle.getDataSource();
    }
}
